home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / DJDEV203.ZIP / readme.1st < prev   
Encoding:
Text File  |  1999-10-18  |  19.1 KB  |  506 lines

  1.  
  2.                ######         #   #####   ######   ######
  3.                #     #        #  #     #  #     #  #     #
  4.                #     #        #  #        #     #  #     #
  5.                #     #        #  #  ####  ######   ######
  6.                #     #  #     #  #     #  #        #
  7.                #     #  #     #  #     #  #        #
  8.                ######    #####    #####   #        #
  9.  
  10.                               DJ Delorie
  11.  
  12.  
  13.           This is the README.1ST file for DJGPP Version 2.03
  14.  
  15. ************************************************************************
  16. *  This file contains information on obtaining, installing, and using  *
  17. *  DJGPP.  Please read it *completely* before asking for help.         *
  18. ************************************************************************
  19.  
  20. DJGPP is a non-proprietary environment for developing 32-bit protected
  21. mode software in C/C++ under MS-DOS.  The DJGPP home page on the WWW
  22. is:
  23.     http://www.delorie.com/djgpp/
  24.  
  25. Status and other information (online docs, FAQ, mail archives) are
  26. made available through the DJGPP web pages.  Discussion of DJGPP and
  27. questions about its usage or features are through the djgpp news group
  28. (post to comp.os.msdos.djgpp) and djgpp mailing list (send your
  29. messages to <djgpp@delorie.com>, subscribe through
  30. <listserv@delorie.com>).  Look on the web page for information on the
  31. latest versions of various DJGPP packages.
  32.  
  33. Version information is in manifest/*.ver within each zip.  Contents
  34. are in manifest/*.mft in each zip.
  35.  
  36. There are also alternate (and usually better) tutorials on getting,
  37. setting up, and using djgpp available on the World Wide Web:
  38.  
  39.     http://www.delorie.com/djgpp/doc/
  40.  
  41.  
  42.  
  43. THE DISTRIBUTION
  44. ****************
  45.  
  46. The DJGPP distribution is broken into a few subdirectories, by
  47. content.  Each subdirectory has a file called 00_index.txt that
  48. contains descriptions of each of the files in that directory.
  49.  
  50. The 'b' zips include the binaries and on-line documentation.  At the
  51. time of writing this file, the various packages are:
  52.  
  53. FAQ      A short file which points you to other documents you should
  54.            read (including the full FAQ list).
  55.  
  56. v2/
  57. unzip32  A free program to unzip the archive (like PKUNZIP) 
  58. djdev203 DJGPP V2 Development Kit and Runtime
  59. djlsr203 DJGPP V2 Base Library Sources
  60. djtst203 DJGPP V2 Test Programs (for testing the C library)
  61. djcrx203 DJGPP V2 Cross-to-DOS Compiler Support Files (from djlsr/djdev)
  62. djtzn203 DJGPP V2 Timezone Files
  63. djtzs203 DJGPP V2 Timezone Sources
  64. faq*b    The full FAQ list in various formats (Info, ASCII, HTML...)
  65. faq*s    The Texinfo sources of the FAQ and tools to generate all the
  66.           different formats of the FAQ
  67. frfaq*   DJGPP FAQ en Francais
  68.  
  69. v2apps/
  70. (various applications built with/for DJGPP, like RHIDE and TeX)
  71.  
  72. v2gnu/
  73. (ports of various FSF/GNU programs to DJGPP, like gcc and binutils)
  74.  
  75. v2tk/
  76. (various toolkits for use with DJGPP, like Allegro and libsocket)
  77.  
  78. v2misc/
  79. csdpmi* CWSDPMI, Charles Sandmann's free DPMI server binaries and docs
  80. mlp*    ML's Executable File Packer Binaries ("djp")
  81. pmode*  PMODE stub for djgpp V2
  82. wmemu*  WM's alternative 387 emulator binaries for DJGPP V2
  83. (and other miscellaneous things to use with DJGPP)
  84.  
  85.  
  86.  
  87. GETTING STARTED
  88. ***************
  89.  
  90. The info below is the minimum new users should know to get them up and
  91. running with DJGPP.  Please read the DJGPP documentation and the FAQ
  92. list for further details.  New users are encouraged to read the FAQ
  93. list in its entirety.
  94.  
  95.  
  96.  
  97. What to download
  98. ----------------
  99.  
  100. See http://www.delorie.com/djgpp/zip-picker.html for a form-based
  101. guide to what to download.  In general, download the binary
  102. distributions only; most people don't need the source distributions.
  103.  
  104. To build C programs, you'll need djdev203.zip, gcc*b.zip, and
  105. bnu*b.zip.  For C++, also get gpp*b.zip.
  106.  
  107. To read the online manuals, get txi*b.zip and run "info".  If you don't
  108. have a DPMI server installed, you'll need csdpmi*b.zip.  (Windows, QDPMI,
  109. 386Max, NWDOS, OpenDOS, OS/2, Win/NT and Linux DOSEmu all provide DPMI
  110. services, so you don't need CWSDPMI in those environments.)  For more
  111. details, download faq*b.zip (the full FAQ list) and read Chapter 4,
  112. "Where and What to Download".
  113.  
  114.  
  115. Installation
  116. ------------
  117.  
  118. 1. Create a directory for DJGPP, say C:\DJGPP.  (WARNING: do NOT
  119.    install DJGPP in a directory C:\DEV, D:\DEV, etc., or in any of their
  120.    subdirectories: it will not work!  See the FAQ for more details.)
  121.  
  122.    If you have version 1.x installed, it's best to delete the contents
  123.    of its `bin/' subdirectory or move it to another directory (not on
  124.    your PATH), and delete everything else from that installation.
  125.    (Some of the problems reported by users of DJGPP v2 were caused by
  126.    inadvertently mixing it with old v1.x programs.)  The only program
  127.    from v1.x that you should keep is `go32.exe'.
  128.  
  129. 2. Unzip all the zip files from that directory, preserving the
  130.    directory structure.  For example:
  131.  
  132.     pkunzip -d djdev203
  133.   or
  134.     unzip32 djdev203
  135.  
  136.    On Windows 9X, use an unzip program which supports long file names.
  137.    Latest versions of InfoZip's UnZip and PKUnZip, as well as WinZip,
  138.    all support long file names.  unzip32.exe, available from the DJGPP
  139.    sites, also supports long file names.  One way to make sure you have
  140.    preserved long file names is to look for a file include/sys/sysmacros.h:
  141.    if you see only sysmacro.h instead, your unzip program does NOT
  142.    support long filenames, and you need to find another one.
  143.  
  144. 3. After unzipping all the zip files, set the DJGPP environment
  145.    variable to point to the file DJGPP.ENV in the main DJGPP
  146.    installation directory and add its BIN subdirectory to your PATH.
  147.  
  148.    The exact way how these variables should be set depends on your
  149.    operating system:
  150.  
  151.    * For Windows 98 systems:
  152.  
  153.      - Click START;
  154.      - Choose Programs->Accessories->System Tools->System Information;
  155.      - Click Tools in the menu-bar, then choose "System Confuguration";
  156.      - Use the tab provided there for editing your AUTOEXEC.BAT as
  157.        explained below.
  158.  
  159.    * For Windows NT systems:
  160.  
  161.      - Right-click "My Computer", then select "Properties";
  162.      - Click the "Environment" tab;
  163.      - Edit the PATH system variable to add the DJGPP bin subdirectory;
  164.      - Add a new variable DJGPP and set its value to the full path
  165.        name of the DJGPP.ENV file as explained below.
  166.  
  167.    * For all other systems (DOS, Windows 3.X and Windows 95): use any
  168.      text editor, e.g. the standard EDIT, to edit the file
  169.      AUTOEXEC.BAT in the root directory of the boot drive (usually,
  170.      C:).
  171.  
  172.    No matter which method you use, assuming your DJGPP installation is
  173.    rooted at C:\DJGPP, the values of the two environment variables
  174.    DJGPP and PATH should be set like this:
  175.  
  176.     set DJGPP=C:\DJGPP\DJGPP.ENV
  177.     set PATH=C:\DJGPP\BIN;%PATH%
  178.  
  179. 4. Reboot.  This makes sure the two lines you added to autoexec.bat
  180.    will take effect.  (On Windows NT, the changes take effect
  181.    immediately, so you you don't need to reboot there.)
  182.  
  183. 5. Run the go32-v2.exe program without arguments:
  184.  
  185.     go32-v2
  186.  
  187.    It should report how much DPMI memory and swap space can DJGPP use
  188.    on you system, like this:
  189.  
  190.     DPMI memory available: 8020 Kb
  191.     DPMI swap space available: 39413 Kb
  192.  
  193.    The actual numbers will vary according to amount of RAM installed
  194.    on your system, the available disk space and the DPMI server.  If
  195.    the sum of the two numbers reported by go32-v2 is less than 4MB,
  196.    read section 3.9 of the FAQ, "How to configure your system for
  197.    DJGPP".  (If you have more than that, but want to get the optimal
  198.    performance from your system, read that section anyway.)
  199.  
  200.  
  201. Compilation
  202. -----------
  203.  
  204. GCC is a command-line compiler which you invoke from the DOS command
  205. line.  To compile and link a single-file C program, use a command like
  206. this:
  207.  
  208.     gcc myfile.c -o myfile.exe -lm
  209.  
  210. The -lm links in the lib/libm.a library (trig math) if needed.  (Link
  211. order is significant, so if you need libm.a, always put `-lm' at the
  212. end of the command line.)
  213.  
  214. To compile a C or C++ source file into an object file, use this
  215. command line:
  216.  
  217.     gcc -c -Wall myfile.c  (for C source)
  218.   or
  219.     gcc -c -Wall myfile.cc (for C++ source)
  220.  
  221. This produces the object file myfile.o.  The `-Wall' switch turns on
  222. many useful warning messages which are especially beneficial for new
  223. users of GCC.  (Other C++ extensions, like .cpp, are also supported,
  224. see section 8.4 of the FAQ, "How does GCC recognize the source
  225. language", for details.)
  226.  
  227. To link several C object files into an executable program, use a
  228. command line such as this:
  229.  
  230.     gcc -o myprog.exe mymain.o mysub1.o mysub2.o
  231.  
  232. This produces `myprog.exe' which can be run from the DOS prompt.
  233.  
  234. To link a C++ program, use gxx instead of gcc, like this:
  235.  
  236.     gxx -o myprog.exe mymain.o mysub1.o mysub2.o
  237.  
  238. This will automatically search the C++ libraries, so you won't need to
  239. mention them on the command line.
  240.  
  241. You can also combine the compilation and link steps, like this:
  242.  
  243.     gcc -Wall -o myprog.exe mymain.c mysub1.c mysub2.c
  244.  
  245. Further info about the plethora of GCC switches can be found in the
  246. GCC on-line documentation.  To begin reading it, install the Texinfo
  247. package (txi*b.zip, see the ``On-line docs'' section below) and type
  248. this:
  249.  
  250.     info gcc invoking
  251.  
  252.  
  253.  
  254. Development environment (aka IDE)
  255. ---------------------------------
  256.  
  257. Currently, DJGPP doesn't come with an integrated environment of its
  258. own.  You are free to choose any editor that can launch DOS programs
  259. and catch their output, to act as an IDE.  Many people who work with
  260. DJGPP use a DOS port of GNU Emacs (it's available in the v2gnu
  261. subdirectory) which can be compiled with DJGPP.  Emacs is a very
  262. powerful editor (for example, it has a built-in Info reader, so you
  263. can read DJGPP documentation without leaving the editor), but many
  264. other free editors can serve as an IDE.  The only task that these
  265. editors (including Emacs) cannot do is to run a debugger in a
  266. full-screen session.
  267.  
  268. A DJGPP-specific IDE called RHIDE has recently been released and is
  269. now available to all DJGPP users.  It features a Turbo C-style
  270. interface, auto-indentation, color syntax highlighting, automatic
  271. invocation of the DJGPP compiler, automatic Makefile generation, and
  272. easy access to the DJGPP online documentation.  RHIDE also
  273. incorporates integrated and/or standalone debugging using the same
  274. functionality as the GNU Debugger (gdb).  Since RHIDE is brand new,
  275. there are still revisions and bugfixes being made; visit
  276. http://www.tu-chemnitz.de/~sho/rho/rhide.html for the latest
  277. information and updates.
  278.  
  279.  
  280.  
  281. Debugging
  282. ---------
  283.  
  284. To debug a program, you must first compile its source files with the
  285. `-g'switch:
  286.  
  287.     gcc -c -Wall -g mymain.c
  288.     gcc -c -Wall -g mysub1.c
  289.     gcc -c -Wall -g mysub2.c
  290.  
  291. and then link with `-g' as well:
  292.  
  293.     gcc -g -o myprog.exe mymain.o mysub1.o mysub2.o
  294.  
  295. (Note that beginning with v2.01 of DJGPP, it is no longer necessary to
  296. compile to a raw COFF output by omitting the `.exe' from the filename
  297. in order to debug programs.  The debuggers distributed with v2.01 and
  298. later are capable of reading an executable as well as the raw COFF.
  299. If you don't understand what this means, don't worry about it.)
  300.  
  301. Then run your program under the debugger:
  302.  
  303.     fsdb myprog.exe
  304. or
  305.     gdb myprog.exe
  306. or
  307.     edebug32 myprog.exe
  308.  
  309. (You will have to get gdb*b.zip if you want to debug with GDB.)
  310. FSDB has a help screen; press F1 to read it.  GDB comes with Info
  311. docs (see below) which can be read with info.exe.  Edebug32 is a
  312. seldom-used alternative debugger; type 'h' to get help.
  313.  
  314.  
  315.  
  316. On-line docs
  317. ------------
  318.  
  319. Most of the on-line documentation is organized in a special hypertext
  320. format used by the GNU project.  Each package comes with its own docs,
  321. in files with the .iNN extension which are unzipped into the info/
  322. subdirectory of your main DJGPP installation directory.  To browse
  323. these docs, get and unzip the file txi*b.zip, then run info.exe.  If
  324. you don't know how to use Info, read the next section.
  325.  
  326.  
  327.  
  328. Reading the documentation, or A Crash Course in Info
  329. ----------------------------------------------------
  330.  
  331. The following is not supposed to be a complete guide to using Info,
  332. but just a starting point, so you could move around the docs and
  333. search it efficiently for specific subjects.
  334.  
  335. To invoke Info to read a manual, type "info" followed by the manual
  336. name.  For example:
  337.  
  338.   - type "info libc" to read the C library docs;
  339.   - type "info libc alphabetical printf" to read the documentation
  340.     of library function `printf';
  341.   - type "info gcc" to read the manual for GCC, the GNU C compiler;
  342.   - type "info faq" to read the DJGPP FAQ list;
  343.   - type "info make" to read the manual for the Make utility;
  344.   - type "info" to get a menu of all the manuals.
  345.  
  346. To exit Info, press `q' (for Quit).
  347.  
  348. Once inside Info, you can move around with the usual cursor motion
  349. keys: Up-arrow, Down-arrow, PageDown, PageUp, etc.  
  350.  
  351. To read the entire manual in an orderly fashion, press SPACE every
  352. time you've completed reading a screenful.  This will take you through
  353. the entire sequence of chapters and sections of a manual.
  354.  
  355. Menus are marked by a line that says "* Menu:".  Each line below the
  356. menu marker that begins with a "* " is a menu item.  To choose a menu
  357. item, position the cursor at the beginning of a line, right under the
  358. asterisk `*', and press [Enter].
  359.  
  360. Hypertext links are marked by "* Note".  To follow the reference,
  361. position the cursor at the asterisk, then press [Enter].  To get back
  362. from the excursion, press `l' (that's a lower-case letter ell, not the
  363. digit one), for "Last".
  364.  
  365. To quickly search for a particular subject in the index of a manual,
  366. press `i' (for Index), type the subject, then press [Enter].  You can
  367. type only part of the subject name and press TAB, to see whether the
  368. index includes any entries that begin with what you typed.  TAB causes
  369. Info to try to complete what you typed using the available index
  370. entries.  If Info beeps at you or flashes the screen colors when you
  371. press TAB, it means that there are no index entries which begin with
  372. what you typed; delete what you have typed (using the BackSpace key)
  373. and try a different name for what you were looking for.  If there are
  374. some index entries that begin with what you typed, Info will complete
  375. it.  If the completed entry looks like what you are looking for, press
  376. [Enter] to go to the section of the manual that discusses it; if not,
  377. press TAB again to see all the possible completions.  If any of the
  378. completions seem right, type enough text to make it unique and press
  379. [Enter].  If none of the completions seem appropriate, delete what you
  380. typed and try a different subject name.
  381.  
  382. For example, suppose you get the infamous message "ld.exe: cannot open
  383. -lstdcxx: No such file or directory" and you want to check what the
  384. FAQ has to say about that.  You start Info ("info faq"), then press
  385. `i' and type "c a n TAB" (without the blanks).  The first TAB just
  386. capitalizes "can" into "Can", so you know there are some index entries
  387. which begin with "Can", and type TAB again.  Now you will see a list
  388. of potential completions.  Alas, none of them seems to be relevant for
  389. this problem, so you use BackSpace to delete "Can" and then type
  390. "-lstd" followed by TAB.  Now Info has only one choice so it completes
  391. your search and this time it's exactly what you are looking for!
  392. Finally, press [Enter] to go to that node and read what the FAQ has to
  393. say about this subject.
  394.  
  395. If you prefer to look up the subject in the index yourself, page
  396. through the top-level menu of the manual until you find a menu entry
  397. that says something like "* Concept Index" or "* Command Index" or
  398. just "* Index", press [Enter] to go to the index, then browse it for
  399. any pertinent entries.  An index is just a huge menu sorted in
  400. alphabetical order, so find an entry you are looking for, position the
  401. cursor at the beginning of its line, and press [Enter] to go to the
  402. relevant section.
  403.  
  404. The library reference doesn't have an index, so search for functions
  405. either in the alphabetical list or in the functional categories.  For
  406. example, library function `mktime' is in the "Time Functions"
  407. category, `random' is in the "Random Number Functions" category, etc.
  408.  
  409. Sometimes the index search won't help you (because the indices cannot
  410. list everything).  In this case, press `s' (for Search), type the text
  411. you want to find, and then press [Enter].  Info will search the entire
  412. manual for this string and position you at the first occurrence.  To
  413. search for the next occurrence, press `s' and [Enter] again: Info will
  414. repeat the search.
  415.  
  416. Finally, if you don't know in what manual to look for some subject,
  417. you can use the "--apropos" switch to cause Info to look for that
  418. subject in the indices of every installed manual.  For example,
  419. suppose you have heard that DJGPP programs support file-name
  420. wildcards, but you don't know in which manual to look for their
  421. description.  The following command will ask Info to print all the
  422. sections in every manual whose indices mention the string "wildcard":
  423.  
  424.     info --apropos=wildcard
  425.  
  426. This will run for a while, and then print lines like these:
  427.  
  428.     "(kb)Features" -- Wildcards
  429.     "(kb)Changes in 2.01" -- wildcards
  430.     "(djgppfaq)Filename globbing" -- Filename wildcards expansion
  431.  
  432. The text inside the quotes is the name of the manual and the section
  433. where the subject "wildcard" is discussed.  To invoke Info in order to
  434. read the first entry above, type this:
  435.  
  436.     info --node="(kb)Features"
  437.  
  438. Info has many more commands and options.  To find out, from the
  439. command line type "info info".  To find out even more, type
  440. "info info-standalone".
  441.  
  442.  
  443.  
  444. Compatibility with V2.00
  445. ------------------------
  446.  
  447. If you are upgrading from version 2.00 of DJGPP, you should completely
  448. reinstall all the packages you need to use.  Because of the different
  449. methods used by versions 2.01 and later to handle long command lines
  450. (and long filenames under Win95), mixing V2.00 programs with those
  451. from later versions can cause very subtle and difficult to debug
  452. problems.  See the FAQ section 16.6 for more information.
  453.  
  454.  
  455.  
  456. Compatibility with V1.x
  457. -----------------------
  458.  
  459. Existing binaries compiled under DJGPP V1.x can be used for
  460. applications for which there is no v2.x version.  V1 programs cannot
  461. run V2 programs (but v2 programs *can* run v1 programs), so don't try,
  462. say, using v1.x Make to run v2.x compiler.
  463.  
  464.  
  465.  
  466.  
  467. --- COPYRIGHT ---
  468.  
  469. DJGPP V2 is Copyright (C) 1989-1999 by DJ Delorie.  Some parts of
  470. libc.a are Copyright (C) Regents of the University of California at
  471. Berkeley.
  472.  
  473. GNU software (gcc, make, libg++, etc) is Copyright by the Free
  474. Software Foundation.
  475.  
  476. DJGPP V2's copyright allows it to be used to produce commercial
  477. applications.  However, if you include code or libraries that are not
  478. part of djgpp (like gnu's libg++) then you must comply with their
  479. copyrights.  See Chapter 19 of the FAQ for more details.
  480.  
  481. There was a discussion a while ago on the DJGPP news group about the
  482. copyright of some of libc's functions.  This copyright required that you
  483. mentioned the "University of California, Berkeley" in your
  484. distribution even if it only consisted of binaries, i.e. a compiled
  485. program.  However, the Berkeley license has been changhed in July
  486. 1999, and you don't need to mention their copyright in your
  487. distribution anymore.
  488.  
  489. The functions and files in libc that have the Berkeley copyright are
  490. listed here:
  491.  
  492. from libc/ansi/time/ctime.c: asctime ctime gmtime localtime mktime
  493.     tzset tzsetwall
  494.  
  495. from libc/compat/stdlib/random.c: initstate random setstate srandom
  496.  
  497. ==============================================================================
  498.  
  499.  
  500. Enjoy!
  501.  
  502.  
  503. DJ Delorie
  504. dj@delorie.com
  505. http://www.delorie.com/
  506.